package cn.tedu.front.job.startup;


import cn.tedu.front.job.service.IPositionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

//预热项目启动后 ,将职位添加到es中
@Slf4j
@Component
public class StartUp implements ApplicationRunner {
    @Autowired
    IPositionService positionService;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("开始执行es职位搜索预热");
        positionService.rebuildSearch();
    }
}
